Skip to content

Model L (D3D12): exact-mode bit-exact levers (dec0 W2 tile, skip duplicate reads, c96 knobs) - #304

Draft
phantoslayer21 wants to merge 1 commit into
perf/model-l-hybrid-speedfrom
perf/model-l-exact-speed
Draft

phantoslayer21 wants to merge 1 commit into
perf/model-l-hybrid-speedfrom
perf/model-l-exact-speed

Conversation

@phantoslayer21

Copy link
Copy Markdown
Owner

Bit-exact Model L (\l_mode=hybrid) levers stacked on #298 (\8c07199):

  • \dec0\ W2 at one tile, skip duplicate history/encoder reads, and \c96\ knob set.
  • Verified 0/6 diffs vs \8c07199\ across 1440pQ (\pi=1.0, \pi=1.25) and \640x360\ on RX 9070 XT D3D12 (
    f=0).

…plicate history/encoder reads skipped, c96 knob set

Four changes to the hybrid (l_mode=hybrid) route, each the same bytes by construction (GPU byte check and ABBA timing
pending):
- l_swin_block_c32_dec_coef12_hyb (SW_COEF_ROWS 1, swin_block.hlsl; fused_swin.hlsl regenerated): the coefficient
  epilogue reads channels 0..15 only, so the W2 chain runs one 16-row tile instead of two. Rows 8..15 of tile 0
  (channels 16..23) are replaced by tile 1's rows 0..7 (channels 8..15) through a per-lane LDS fragment offset (24
  slots for the A lanes t >= 8; no weight repack); the chain start RN16(b2 + z) of channels 8..15 moves to the hh = 1
  lane and the epilogue takes them back from lane ^ 16. Every output element is the same chain of the same products.
  RGA gfx1201: 64 -> 56 WMMAs per block (W2 16 -> 8), 84 / 96 VGPRs, no spills; hyb_isa_scan 0 fused squares,
  0 of 96 FP8 sources not FP16; its scan mutant still fails both rules.
- l_post_core.hlsli (w64_lc12/l_post_tf_p12[_pf]): the second history candidate at the first one's motion bits reads
  the same position; its values are copied instead of a second 12-tap history read. RGA 89 -> 93 and 86 -> 90 VGPRs
  (bound 96, LDS-capped at 2 workgroups per CU either way), no spills.
- encoder.hlsl, q20 forms only (lev/input_encoder_q20[_pf], _direct_q20): near / far at center's position bits reuse
  center's history values; the reads run only when a lane of the wave needs them. RGA: 104 -> 82 VGPRs (q20),
  106 -> 85 (q20_pf). Model M's encoders unchanged.
- swin_block_c96_hyb / swin_block_c96_add_ex_hyb: the knob set their scan mutants and q7c twins already run
  (SW_MLP_PAIRS 1, SW_COMMIT_EARLY 1, SW_NORM2_EARLY 1; scheduling only). RGA 190 -> 191 and 158 -> 158 VGPRs;
  hyb_isa_scan 0 / 0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant